#!/usr/bin/perl -w
=head1 NAME

 upgrade.pl

=head1 SYNOPSIS

 Upgrade script for dust

=head1 DESCRIPTION

 Portions copied from 'apt-cacher'.

=cut

my $path = $ENV{PATH_INFO};

#############################################################################
### configuration ###########################################################
# Include the library for the config file parser
require '/usr/share/dust/dust-lib.pl';

# Read in the config file and set the necessary variables
my $config_file = '/etc/dust/dust.conf';

my $config_ref;
eval {
        $config_ref = read_config($config_file);
};
my %config = %$config_ref;

# Not sure what to do if we can't read the config file...
die "Could not read config file: $@" if $@;

# Now set some things from the config file
# $log_file used to be set in the config file: now we derive it from $logdir
$config{log_file} = "$config{log_dir}/access.log";

# $error_file used to be set in the config file: now we derive it from $logdir
$config{error_file} = "$config{log_dir}/error.log";

################################################

exit(0);
